#include <iostream>
#include <tuple>

// 使用 std::tuple 返回多个值
auto find() { return std::make_tuple(1001, "Bob", 88.5); }

int main(int argc, char *argv[]) {
  std::cout << "==== ch01 p13 ====" << std::endl;

  // 结构化绑定将 tuple 解包为多个变量
  auto [id, name, score] = find();
  std::cout << "id: " << id << ", name: " << name << ", score: " << score
            << std::endl;

  // if 中使用
  if (auto [id, name, score] = find(); score >= 85.0) {
    std::cout << "Good score!" << std::endl;
  }
  return 0;
}
